// c++抛出异常示例
#include <iostream>
using namespace std;

float divider(float a,float b)
{
    //当除数为零时，抛出异常
    if(b == 0)
        throw "除数不可为零";
    if(b > 1000)
        throw 1;
    return a/b;
}

int main(void)
{
    float a,b,ans;

    while(1)
    {
        cin >> a >> b;

        //试图执行a/b
        try
        {
            ans = divider(a,b);
        }
        catch(int &e)
        {
            cout << "除数太大了，算不出来" << endl;
            continue;
        }
        catch(const char * &e)
        {
            //发生了异常
            cout << e << endl;
            continue;
            //break;
        }

        cout << ans <<endl;
    }

    return 0;
}